package org.dzq.designmode.composite;

/**
 * @ClassName: OriginalComponent
 * @Package: org.dzq.designmode.composite
 * @author: 越
 * @date: 2023/6/17 16:24
 * @Description: 抽象节点
 */
public abstract class Component {

    protected String name;

    public Component(String name){
        this.name = name;
    }

    public abstract void printTree();

    public boolean addChild(Component component){
        throw new UnsupportedOperationException();
    }

    public boolean removeChild(Component component){
        throw new UnsupportedOperationException();
    }

    public Component getChild(int index){
        throw new UnsupportedOperationException();
    }

}
